package org.example.service;

import org.example.exception.MyException;

public class UserServiceImpl implements UserService{
    //属于AOP的连接点
    @Override
    public void selectUser() throws MyException {
        System.out.println("已查询到软件技术学生用户有261人");


//        try捕获错误。如报错，执行e.getMessage(),无论如何finally{}执行.
        try{
            throw new ArithmeticException();
        }catch (Exception e){
            e.getMessage();
        }finally {
            System.out.println("已查询到软件技术学生用户有261人");
            throw new MyException();
        }
    }

    @Override
    public void insertUser() {

    }
}
